Skip to content

[fix](be) Scope Parquet bloom cache to row groups#65487

Closed
Gabriel39 wants to merge 1 commit into
masterfrom
codex/fix-parquet-row-group-bloom-cache
Closed

[fix](be) Scope Parquet bloom cache to row groups#65487
Gabriel39 wants to merge 1 commit into
masterfrom
codex/fix-parquet-row-group-bloom-cache

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary:

Parquet row-group pruning cached Bloom filters only by leaf column ID. Once a column Bloom filter was loaded for the first row group, subsequent row groups reused that filter. An equality or IN predicate could therefore prune a later row group based on an absence result from the first row group's Bloom filter, silently omitting matching rows.

This change scopes both the cached Bloom filter and its loaded state by (row_group_idx, leaf_column_id), ensuring every absence decision uses the current row group's filter.

The test fixture was generated by parquet-mr 1.17.0 with four INT32 rows split into two row groups, real Bloom filters enabled for id, and statistics/dictionary encoding disabled. The unit test verifies both row groups expose Bloom filters and compares pruning with Bloom disabled and enabled. A value present only in RG1 keeps RG1 selected while RG0 is pruned.

Release note

Fix incorrect Parquet Bloom filter pruning that could silently omit rows from later row groups.

Check List (For Author)

  • Test:
    • Unit Test: ParquetStatisticsPruningTest.BloomFilterCacheIsScopedToRowGroupAndColumn
    • BE clang-format v16 check
    • BE clang-tidy attempted; blocked by unrelated remote toolchain/pre-existing diagnostics (stddef.h lookup and existing NOLINT/readability findings)
  • Behavior changed: Yes. Parquet Bloom pruning now uses each row group's own filter.
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary: Parquet row-group pruning cached Bloom filters only by leaf column id. After the first row group loaded a column Bloom filter, later row groups reused that filter and could be incorrectly pruned when a matching value existed only outside the first row group. Scope cache entries by both row group and leaf column so absence checks always use the current row group's Bloom filter. Add a parquet-mr fixture with two row groups and real Bloom data plus an enabled/disabled differential unit test.

### Release note

Fix incorrect Parquet Bloom filter pruning that could silently omit rows from later row groups.

### Check List (For Author)

- Test: Unit Test
    - ParquetStatisticsPruningTest.BloomFilterCacheIsScopedToRowGroupAndColumn
- Behavior changed: Yes, Parquet Bloom pruning now uses each row group's own filter
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Gabriel39

Copy link
Copy Markdown
Contributor Author

run buildall

@Gabriel39 Gabriel39 marked this pull request as ready for review July 12, 2026 04:21
@Gabriel39 Gabriel39 requested a review from yiguolei as a code owner July 12, 2026 04:21
@Gabriel39

Copy link
Copy Markdown
Contributor Author

Closing this PR because the head branch was mistakenly pushed to apache/doris. It will be resubmitted from the Gabriel39 fork.

@Gabriel39 Gabriel39 closed this Jul 12, 2026
@Gabriel39 Gabriel39 deleted the codex/fix-parquet-row-group-bloom-cache branch July 12, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants